function f()
    println("f starting...")
    println("f pause 1...")
    yield()                       # 要求切换到别的Task
    println("f back 1 and pause 2...")
    yield()                       # 要求切换到别的Task
    println("f back.")
    println("f finished.")
end

function g()
    println("g starting...")
    println("g pause 1...")
    yield()                      # 要求切换到别的Task
    println("g back 1 and pause 2...")
    yield()                      # 要求切换到别的Task
    println("g back.")
    println("g finished.")
end

t1 = Task(f)
t2 = Task(g)

schedule(t1)
schedule(t2)

read(stdin, Char)
